#include "app_pool.h"

#define _GNU_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

void test(void *arg)
{
    char *parm = (char *)arg;
    printf("test parm:%s,id:%d\n", parm, gettid());
}

int main(int argc, char const *argv[])
{
    /* 1.初始化线程池 */
    if (app_pool_init(100) != SUCCESS)
    {
        printf("app_pool_init failed\n");
    }

    /* 2.注册回调函数 */
    for (int i = 0; i < 10; i++)
    {
        app_pool_register(test, "hello world");
    }

    
    sleep(1);

    /* 3.结束清理 */
    app_pool_destroy();

    return 0;
}
